<?php

$root = '../';
include('../system/core.php');
$rekl = mysql_query("SELECT * FROM `rekl` WHERE `finish`>'" .time(). "'");

if(!$rights){
    header('Location: http://'.$set['home'].'/index.php');
    exit;
}

$title = 'Реклама на WBCMS';
include('../system/head.php');
echo '<div class="title">'.$lang['ads'].'</div>';
if (isset($_POST['text'])){
    $acces = $_POST['acces'];
    if(!$acces)$acces=0;
$day = $_POST['day']*3600*24;
$time= $day + time();
mysql_query("INSERT INTO `rekl` (ssil, text, start, finish, redirect) VALUES ('".$_POST['ssil']. "','".mysql_real_escape_string($_POST['text'])."', '" .time(). "', '$time', '$acces');");
echo '<div class="omenu">'.$lang['ads_add'].'</div>';
}
echo '<div id="imenu"><div class="info">';
echo '<form action="add.php" method="post">';
echo "$lang[title]:";
echo '<div class="bb_panel">'; //BB CODES BY SCREAMER w-board.su - Thank You
				?> <a href="javascript:insert_bb('[b]', '[/b]')"><strong>B</strong></a>'; 
                <a href="javascript:insert_bb('[i]', '[/i]')"><i>I</i></a>';
                <?
                //BB CODES BY SCREAMER w-board.su - Thank You
			echo '</div>';
		#	echo '<textarea name="post" id="post"></textarea>';
				echo '</p>';
echo '<input type="text" name="text" id="post" maxlenght="200"><br>';
echo "$lang[url]: [$lang[bezhhtp]]<br />";
echo '<input type="text" name="ssil" maxlen=\'10\'> <br>';
echo "$lang[ads_time]:<br />";
echo '<input type="number" name="day" value="1">';
echo '<p><div class="info"><small>'.$lang['http'].'?</small><br /></p><input type="checkbox" name="acces" value="1"><small>Yes</small></div>';
echo '<p><input type="submit" value="'.$lang['add'].'"></p><br />';
echo '<p><a href="index.php">'.$lang['setting'].'</a></p>';
echo '</div></div>';
echo '<div class="title"><a href="../adm.php">'.$lang['panel'].'</a></div>';
include('../system/foot.php');
?>